﻿<!-- Phan khai bao bien cuc bo-->
<?php
//Luu giu dieu kien loc
$v_page=1;
if(isset($_REQUEST['hdn_page'])){
	$v_page=intval($_REQUEST['hdn_page']);
}
//Bien luu so dong tren mot trang
$v_limit_row = 1;
if(isset($_REQUEST['hdn_record_number_page'])){
	$v_limit_row = intval($_REQUEST['hdn_record_number_page']);
}
//Xau XML luu thong tin cua ho so
$v_xml_received = $arr_single_record['C_RECEIVED_RECORD_XML_DATA'];
//Lay id cua NSD tiep nhap
$v_receiver_id = _get_item_attr_by_id ($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'id');
$v_current_status = ($arr_single_record['C_CURRENT_STATUS']);
$v_detail_status = intval($arr_single_record['C_DETAIL_STATUS']);
$v_recordtype_first_time_fee = $arr_single_recordtype['C_FIRST_TIME_FEE'];
$v_move_to_leader = $arr_single_recordtype['C_MOVE_TO_LEADER'];
if($v_move_to_leader){
	$v_registor_name = _XML_get_xml_tag_value($v_xml_received,'registor_name','registor_name');	
	$v_money_provisionally = _XML_get_xml_tag_value($v_xml_received,'money_provisionally','money_provisionally');
}//else{
	//$v_xml_received = '';
//	$v_money_provisionally = '';
	
//}
$v_money_provisionally = _XML_get_xml_tag_value($v_xml_received,'money_provisionally','money_provisionally');
if(trim($v_money_provisionally) == ""){
	$v_money_provisionally = 0;
}
//echo 'v_money_provisionally' . $v_money_provisionally;
if(($v_recordtype_filter=='001')
	||($v_recordtype_filter=='002')
	||($v_recordtype_filter=='007e')
	||($v_recordtype_filter=='021a')
	||($v_recordtype_filter=='021b')
	||($v_recordtype_filter=='021c')
	||($v_recordtype_filter=='021d')
	||($v_recordtype_filter=='021e')
	||($v_recordtype_filter=='021f')	
	||($v_recordtype_filter=='009a')
	||($v_recordtype_filter=='009b')	
	||($v_recordtype_filter=='004d')
	||($v_recordtype_filter=='011')		
	||($v_recordtype_filter=='004d')
	|| ($v_recordtype_filter=='013')
	||($v_recordtype_filter=='015')		

){
	$v_registor_name = _XML_get_xml_tag_value($v_xml_received,'registor_name','registor_name');	
}elseif($v_recordtype_filter=='004'){
	$v_registor_name = _XML_get_xml_tag_value($v_xml_received,'user_name','user_name');
}elseif($v_recordtype_filter=='009'){
	$v_registor_name = _XML_get_xml_tag_value($v_xml_received,'toi_ten_la','toi_ten_la');
}elseif($v_recordtype_filter=='004a'){
	$v_registor_name = _XML_get_xml_tag_value($v_xml_received,'ten_ben_the_chap','ten_ben_the_chap');
}elseif($v_recordtype_filter=='004b'){
	$v_registor_name = _XML_get_xml_tag_value($v_xml_received,'ten_tccn_bl','ten_tccn_bl');
}
elseif($v_recordtype_filter=='004c'){
	$v_registor_name = _XML_get_xml_tag_value($v_xml_received,'ten_tccn_yc','ten_tccn_yc');
}else{
	$v_registor_name = "";
}
//Kiem tra NSD co phai la nguoi dong vai tro tiep nhan doi voi loai ho so tuong ung va trang thai la CAP_PHEP va C_DETAIL_STATUS <>51
if ( (onegate_is_receiver_for_recordtype($v_receiver_id,$v_recordtype_filter,$_SESSION["recordtype"])) && $v_detail_status <> 51){
	$v_is_receiver_for_recordtype_and_status = 1;
}else{
	$v_is_receiver_for_recordtype_and_status = 0;
}
$v_date = date("d/m/Y");
$v_display = "none";
if ($v_count_worktype > 0){
	$v_display = "block";
}
$v_file_url = trim(CONST_URL_PATH_FROM_ROOT) . $v_file_name;
$v_goto_url = "javascript:filename_onclick('T_ONEGATE_RECORD_WORK', 'PK_RECORD_WORK', 'C_FILE_NAME', 'C_FILE_CONTENT'," . strval($v_record_work_id) . ",'" . $v_file_url ."');" ;
?>
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="large_title">
		<td><?php echo CONST_RECORD_RESULT_UPDATE_TITLE; ?></td>
	</tr>
</table>
<!-- Bat cac phim: F12=true; Insert=false; Delete=false, ESC=true; Enter=true -->
<div id="hotkey" onKeyDown="javascript:process_hot_key(true,false,false,true,true);">
<!--bang chua cac text box de nhap du lieu-->
<table width="100%" class="form_table1" cellpadding="0" cellspacing="0" border="0">
	<col width="25%"><col width="75%">
	<tr>
		<form action="index.php" method="post" name="frm_single_licence">
		<input type="hidden" name="fuseaction" value="" >
		<input type="hidden" name="hdn_record_id"  value="<?php echo $v_record_id; ?>">
		<input type="hidden" name="hdn_fisrt" value="">
		<input type="hidden" name="hdn_recordtype_filter" value="<?php echo $v_recordtype_filter; ?>">
		<input type='hidden' name='hdn_page' value='<?php echo $v_page;?>'>
		<input type='hidden' name='hdn_record_number_page' value='<?php echo $v_limit_row;?>'>
	</tr>
	<tr>
		<td colspan="10"><?php echo onegate_show_record_general_info($arr_single_record,$_SESSION['recordtype'],true,$p_petition_link,$p_rate_of_progress_link,$p_document_link,$p_idea_link,$p_sign_link,$p_approve_link,$p_licensing_link,$v_url_view_update_record_status); ?></td>
	</tr>
	<tr>
		<td colspan="10" ><hr color="#66CCFF" size="1"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_RECORD_RESULT_DATE_LABEL;?> <small class="normal_starmark">*</small></td>
		<td>
			<input type="text" name="txt_date" class="normal_date_textbox" isdate="true" value="<?php echo $v_date;?>" optional="<?php echo CONST_VALID_DATE_OPTIONAL;?>" message="<?php echo CONST_VALID_DATE_MESSAGE;?>" onKeyDown="change_focus(document.forms(0),this);">
			<img src="<? echo $_ISA_IMAGE_URL_PATH;?>calendar.gif" border="0" onclick="DoCal('<?php echo $_ISA_LIB_URL_PATH; ?>isa-calendar/',document.forms(0).txt_date)" style="cursor:hand;">
		</td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_RECORD_RESULT_RECEIVER_LABEL; ?> <small class="normal_starmark">*</small></td>
		<td><input Name="txt_name"  type="text" class="normal_textbox" style="width:99%" value="<?php echo $v_registor_name;?>" message="<?php echo CONST_RECORD_RESULT_RECEIVER_MESSAGE;?>" optional="<?php echo CONST_RECORD_RESULT_RECEIVER_OPTIONAL;?>" onKeyDown="change_focus(document.forms(0),this)"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_RECORD_RESULT_COST_LABEL; ?></td>
		<td><input Name="txt_cost" value="<?php 
												if($v_move_to_leader){
													echo $v_money_provisionally;
												}else{												
													echo onegate_data_format($v_recordtype_first_time_fee);
												}	
											?>" 
											type="text" class="normal_textbox" isnumeric = "true" message="<?php echo CONST_RECORD_RESULT_COST_MESSAGE;?>" style="width:30%" optional="<?php echo CONST_RECORD_RESULT_COST_OPTIONAL;?>" onKeyUp='format_money(this)' onKeyDown="change_focus(document.forms(0),this)">
											<?php echo CONST_RECORD_RESULT_CURRENCY_LABEL;echo "&nbsp;(" ."<b><font color='#990000' size='2'>" . CONST_RECORD_RESULT_PAID_LABEL . $v_money_provisionally . CONST_RECORD_RESULT_CURRENCY_LABEL . "</font></b>" . ")";?>		
		</td>
	</tr>
</table>
<!--bang chua cac button-->
<table width="100%" >
	<tr>
	<td align="center" width="100%" height="40" valign="bottom"><?php
			if (($v_is_granted_update)|| ($v_is_receiver_for_recordtype_and_status > 0) ){
				$v_url_onclick="save_info('UPDATE_LICENCE_RECORD');";?>
				<input type="button" name="btn_save" class="normal_button" value="<?php  echo _CONST_SAVE_BUTTON;?>" onClick="<?php echo $v_url_onclick;?>" onKeyDown="change_focus(document.forms(0),this);" ><?
			}?>				
			<input type="button" name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="btn_back_onclick('<?php echo $_GO_BACK?>')" onKeyDown="change_focus(document.forms(0),this)">	
		</td>
	</tr>
</table>					
</div>
</form>
<script language="JavaScript">
	set_focus(document.forms(0));

</script>
